// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'camera.dart';

export 'package:camera_platform_interface/camera_platform_interface.dart'
    show
        CameraDescription,
        CameraException,
        CameraLensDirection,
        FlashMode,
        ExposureMode,
        FocusMode,
        ResolutionPreset,
        XFile,
        ImageFormatGroup;

export 'src/camera_controller.dart';
export 'src/camera_image.dart';
export 'src/camera_preview.dart';

enum OverlayStyle {
        ///静默模式
        NoOverlay,
        ///预览模式
        Preview,
        ///色块模式
        Color;
}

/// 视频分辨率
enum Resolution {
        ///2160P
        ultraHigh('超清', ResolutionPreset.ultraHigh),
        ///1080P
        veryHigh('高清', ResolutionPreset.veryHigh),
        ///720P
        high('标清', ResolutionPreset.high),
        ;

        const Resolution(this.desc, this.value);
        final String desc;
        final ResolutionPreset value;

        static Resolution find(int index) {
                return Resolution.values.firstWhere((e) => e.index == index, orElse: ()=> Resolution.veryHigh);
        }
}

/// 图片比例
enum ImageRatio {
        ratio_1_1('1:1'),
        ratio_4_3('4:3'),
        ratio_16_9('16:9'),
        ;

        const ImageRatio(this.desc);
        final String desc;

        static ImageRatio find(int index) {
                return ImageRatio.values.firstWhere((e) => e.index == index, orElse: ()=> ImageRatio.ratio_4_3);
        }
}

///最大录制时长
int MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800;
///最大文件大小
int MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801;